<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/Common Module/userboot.c 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_df4e0e4e72f77ab290fd1a24f190250a.html">Common Module</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">结构体</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a> &#124;
<a href="#var-members">变量</a>  </div>
  <div class="headertitle"><div class="title">userboot.c 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>IAP 实现 UserBoot 功能  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &lt;string.h&gt;</code><br />
<code>#include &quot;<a class="el" href="userboot_8h_source.html">userboot.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="bsp__init_8h_source.html">bsp_init.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
userboot.c 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c__incl.png" border="0" usemap="#a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_common_01_module_2userboot_8c" alt=""/></div>
<map name="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_common_01_module_2userboot_8c" id="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_common_01_module_2userboot_8c">
<area shape="rect" title="IAP 实现 UserBoot 功能" alt="" coords="469,5,693,75"/>
<area shape="rect" title=" " alt="" coords="478,123,543,148"/>
<area shape="rect" href="userboot_8h.html" title="IAP 实现 UserBoot 功能" alt="" coords="81,196,164,221"/>
<area shape="rect" href="bsp__init_8h.html" title="板级硬件外设初始化" alt="" coords="1079,123,1158,148"/>
<area shape="rect" title=" " alt="" coords="794,343,881,368"/>
<area shape="rect" href="load__file_8h.html" title="加载/拷贝文件" alt="" coords="5,269,85,295"/>
<area shape="rect" title=" " alt="" coords="26,343,65,368"/>
<area shape="rect" href="version_8h.html" title="版本/目标控制" alt="" coords="951,269,1025,295"/>
<area shape="rect" href="dev__systick_8h.html" title="系统滴答定时器" alt="" coords="1201,269,1303,295"/>
<area shape="rect" href="dev__uart_8h.html" title="调试日志串口打印" alt="" coords="1327,269,1409,295"/>
<area shape="rect" href="dev__bod_8h.html" title="低电压触发配置" alt="" coords="1433,269,1513,295"/>
<area shape="rect" href="dev__rtc_8h.html" title="RTC 在线计时(No VBAT)" alt="" coords="160,269,235,295"/>
<area shape="rect" href="dev__crc_8h.html" title="硬件 CRC" alt="" coords="259,269,336,295"/>
<area shape="rect" href="dev__sfc_8h.html" title="SPI&#45;Flash Control 硬件专用高速模块" alt="" coords="361,269,437,295"/>
<area shape="rect" href="dev__sdram_8h.html" title="芯片内置 SDRAM" alt="" coords="461,269,555,295"/>
<area shape="rect" href="dev__sdio_8h.html" title="SDIO 驱动 SD 卡" alt="" coords="580,269,663,295"/>
<area shape="rect" href="dev__jpeg_8h.html" title="JPEG 硬件解码" alt="" coords="580,196,663,221"/>
<area shape="rect" href="dev__dac_8h.html" title="DAC 音频播放" alt="" coords="687,196,767,221"/>
<area shape="rect" href="dev__lcd_8h.html" title="LCD 驱动显示" alt="" coords="791,196,867,221"/>
<area shape="rect" href="dev__touch_8h.html" title="TP 触摸设备驱动层" alt="" coords="943,196,1033,221"/>
<area shape="rect" href="dev__sleep__stop_8h.html" title="浅/深睡眠" alt="" coords="1057,196,1180,221"/>
<area shape="rect" href="usbh__user_8h.html" title="USB Host 用户配置" alt="" coords="2296,196,2389,221"/>
<area shape="rect" title=" " alt="" coords="1407,196,1532,221"/>
<area shape="rect" title=" " alt="" coords="1557,196,1681,221"/>
<area shape="rect" title=" " alt="" coords="1705,196,1823,221"/>
<area shape="rect" title=" " alt="" coords="1847,196,1977,221"/>
<area shape="rect" title=" " alt="" coords="2002,196,2123,221"/>
<area shape="rect" title=" " alt="" coords="2147,196,2271,221"/>
<area shape="rect" href="jfif__parser_8h.html" title="jpeg 图片 jfif 格式解析" alt="" coords="687,269,775,295"/>
<area shape="rect" title=" " alt="" coords="2237,269,2331,295"/>
<area shape="rect" href="usbh__conf_8h.html" title="USB Host Config" alt="" coords="2355,269,2447,295"/>
<area shape="rect" href="usbh__msc__conf_8h.html" title="USB Host MSC 类配置" alt="" coords="2339,343,2463,368"/>
</map>
</div>
</div>
<p><a href="userboot_8c_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
结构体</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfw__info__t.html">fw_info_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">固件信息&lt;结构体总大小须保持 4 Word 对齐(因 FLASH_Write() 最少写入 4 个字)&gt;  <a href="structfw__info__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdev__info__t.html">dev_info_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">设备信息&lt;结构体总大小须保持 4 Word 对齐(因 FLASH_Write() 最少写入 4 个字)&gt;  <a href="structdev__info__t.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
宏定义</h2></td></tr>
<tr class="memitem:a126cd8ab631c9b09085d875642eaafc8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a126cd8ab631c9b09085d875642eaafc8">UB_DEBUG_ENABLE</a></td></tr>
<tr class="memdesc:a126cd8ab631c9b09085d875642eaafc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">模块调试日志输出使能宏  <a href="userboot_8c.html#a126cd8ab631c9b09085d875642eaafc8">更多...</a><br /></td></tr>
<tr class="separator:a126cd8ab631c9b09085d875642eaafc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a6f5a01513f0f9ca1e58abdd5fdf68d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a2a6f5a01513f0f9ca1e58abdd5fdf68d">UB_LOG</a>(...)&#160;&#160;&#160;printf(__VA_ARGS__)</td></tr>
<tr class="memdesc:a2a6f5a01513f0f9ca1e58abdd5fdf68d"><td class="mdescLeft">&#160;</td><td class="mdescRight">模块调试日志打印宏  <a href="userboot_8c.html#a2a6f5a01513f0f9ca1e58abdd5fdf68d">更多...</a><br /></td></tr>
<tr class="separator:a2a6f5a01513f0f9ca1e58abdd5fdf68d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19a96f539c8c822d99992939cc6e6a29"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>&#160;&#160;&#160;(4096)</td></tr>
<tr class="memdesc:a19a96f539c8c822d99992939cc6e6a29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flash-IAP 操作须对齐的大小( 4K 对齐 )  <a href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">更多...</a><br /></td></tr>
<tr class="separator:a19a96f539c8c822d99992939cc6e6a29"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:a01aae38566ae3dd519a6c18696ab2806"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a01aae38566ae3dd519a6c18696ab2806">reset_mcu</a> (void)</td></tr>
<tr class="memdesc:a01aae38566ae3dd519a6c18696ab2806"><td class="mdescLeft">&#160;</td><td class="mdescRight">重启 MCU  <a href="userboot_8c.html#a01aae38566ae3dd519a6c18696ab2806">更多...</a><br /></td></tr>
<tr class="separator:a01aae38566ae3dd519a6c18696ab2806"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78c7624204dca44707593279758c0c98"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a78c7624204dca44707593279758c0c98">jump_to_app</a> (const uint32_t addr)</td></tr>
<tr class="memdesc:a78c7624204dca44707593279758c0c98"><td class="mdescLeft">&#160;</td><td class="mdescRight">跳转至 APP 加载地址运行  <a href="userboot_8c.html#a78c7624204dca44707593279758c0c98">更多...</a><br /></td></tr>
<tr class="separator:a78c7624204dca44707593279758c0c98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeeea4715dd32a4a4ecdf61a2869d1307"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307">calculate_crc</a> (<a class="el" href="structfw__info__t.html">fw_info_t</a> *data)</td></tr>
<tr class="memdesc:aeeea4715dd32a4a4ecdf61a2869d1307"><td class="mdescLeft">&#160;</td><td class="mdescRight">计算 CRC 校验和  <a href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307">更多...</a><br /></td></tr>
<tr class="separator:aeeea4715dd32a4a4ecdf61a2869d1307"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9412f435ea365342178b2399fc08a846"><td class="memItemLeft" align="right" valign="top">static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846">set_device_info</a> (const <a class="el" href="structdev__info__t.html">dev_info_t</a> *ptr)</td></tr>
<tr class="memdesc:a9412f435ea365342178b2399fc08a846"><td class="mdescLeft">&#160;</td><td class="mdescRight">写入固件信息, 并自带回读校验  <a href="userboot_8c.html#a9412f435ea365342178b2399fc08a846">更多...</a><br /></td></tr>
<tr class="separator:a9412f435ea365342178b2399fc08a846"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a43be464e9071b97862e51b2273afd856"><td class="memItemLeft" align="right" valign="top">static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a43be464e9071b97862e51b2273afd856">firmware_backup</a> (const char *path, <a class="el" href="userboot_8h.html#a73b10fad3e8bed1f1afc0b09e52b4498">data_code_cb</a> data_enc)</td></tr>
<tr class="memdesc:a43be464e9071b97862e51b2273afd856"><td class="mdescLeft">&#160;</td><td class="mdescRight">固件备份 (Chip-Flash&lt;运行区&gt; =&gt; 本地存储&lt;备份区&gt;)  <a href="userboot_8c.html#a43be464e9071b97862e51b2273afd856">更多...</a><br /></td></tr>
<tr class="separator:a43be464e9071b97862e51b2273afd856"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1cbf84771d87b5530710ae6852bd827"><td class="memItemLeft" align="right" valign="top">static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#ae1cbf84771d87b5530710ae6852bd827">firmware_update</a> (const char *path, <a class="el" href="userboot_8h.html#a73b10fad3e8bed1f1afc0b09e52b4498">data_code_cb</a> data_dec)</td></tr>
<tr class="memdesc:ae1cbf84771d87b5530710ae6852bd827"><td class="mdescLeft">&#160;</td><td class="mdescRight">固件更新 (本地存储&lt;备份区&gt; =&gt; Chip-Flash&lt;运行区&gt;)  <a href="userboot_8c.html#ae1cbf84771d87b5530710ae6852bd827">更多...</a><br /></td></tr>
<tr class="separator:ae1cbf84771d87b5530710ae6852bd827"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d51bf8d3184d1c34b5fde41d69b1559"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559">userboot</a> (void)</td></tr>
<tr class="memdesc:a5d51bf8d3184d1c34b5fde41d69b1559"><td class="mdescLeft">&#160;</td><td class="mdescRight">UserBoot 功能  <a href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559">更多...</a><br /></td></tr>
<tr class="separator:a5d51bf8d3184d1c34b5fde41d69b1559"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdd804b92809fcd58b2bc135fc74666c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#acdd804b92809fcd58b2bc135fc74666c">jump_to_userboot</a> (uint32_t boot_flag, bool wait)</td></tr>
<tr class="memdesc:acdd804b92809fcd58b2bc135fc74666c"><td class="mdescLeft">&#160;</td><td class="mdescRight">跳转至 UserBoot 执行对应动作  <a href="userboot_8c.html#acdd804b92809fcd58b2bc135fc74666c">更多...</a><br /></td></tr>
<tr class="separator:acdd804b92809fcd58b2bc135fc74666c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a759a4106353e92e06e9d15926228c576"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a759a4106353e92e06e9d15926228c576">firmware_download</a> (const char *src_path, const char *dst_path, <a class="el" href="userboot_8h.html#a73b10fad3e8bed1f1afc0b09e52b4498">data_code_cb</a> data_enc)</td></tr>
<tr class="memdesc:a759a4106353e92e06e9d15926228c576"><td class="mdescLeft">&#160;</td><td class="mdescRight">固件下载 (外部 =&gt; 本地)  <a href="userboot_8c.html#a759a4106353e92e06e9d15926228c576">更多...</a><br /></td></tr>
<tr class="separator:a759a4106353e92e06e9d15926228c576"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a52a519a37465a7b4515a237114afa802"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a52a519a37465a7b4515a237114afa802">data_encode</a> (const void *src_buff, void *dst_buff, uint32_t bytes)</td></tr>
<tr class="memdesc:a52a519a37465a7b4515a237114afa802"><td class="mdescLeft">&#160;</td><td class="mdescRight">数据加密  <a href="userboot_8c.html#a52a519a37465a7b4515a237114afa802">更多...</a><br /></td></tr>
<tr class="separator:a52a519a37465a7b4515a237114afa802"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0591f13c34e15c4d9fbe31fd99726a94"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a0591f13c34e15c4d9fbe31fd99726a94">data_decode</a> (const void *src_buff, void *dst_buff, uint32_t bytes)</td></tr>
<tr class="memdesc:a0591f13c34e15c4d9fbe31fd99726a94"><td class="mdescLeft">&#160;</td><td class="mdescRight">数据解密  <a href="userboot_8c.html#a0591f13c34e15c4d9fbe31fd99726a94">更多...</a><br /></td></tr>
<tr class="separator:a0591f13c34e15c4d9fbe31fd99726a94"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
变量</h2></td></tr>
<tr class="memitem:ac8462a2c24f4214d1a59575a24920bbe"><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#ac8462a2c24f4214d1a59575a24920bbe">Chip_Flash_Max_Size</a> = 0x80000</td></tr>
<tr class="memdesc:ac8462a2c24f4214d1a59575a24920bbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">SWM341 系列 Flash 容量上限 512K Bytes  <a href="userboot_8c.html#ac8462a2c24f4214d1a59575a24920bbe">更多...</a><br /></td></tr>
<tr class="separator:ac8462a2c24f4214d1a59575a24920bbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71659dad8cb67ca7cd6b16840ad9b2f3"><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a71659dad8cb67ca7cd6b16840ad9b2f3">UserBoot_Addr</a> = 0x00000</td></tr>
<tr class="memdesc:a71659dad8cb67ca7cd6b16840ad9b2f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">UserBoot 加载地址  <a href="userboot_8c.html#a71659dad8cb67ca7cd6b16840ad9b2f3">更多...</a><br /></td></tr>
<tr class="separator:a71659dad8cb67ca7cd6b16840ad9b2f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e49962dc2be19adc1eb81eae2a78320"><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a7e49962dc2be19adc1eb81eae2a78320">UserBoot_Size</a> = 0x10000</td></tr>
<tr class="memdesc:a7e49962dc2be19adc1eb81eae2a78320"><td class="mdescLeft">&#160;</td><td class="mdescRight">UserBoot 预设大小 &lt;4K 对齐&gt; (可预留多一些, 以便后续有更新 UserBoot 的需求, 暂未预留接口实现)  <a href="userboot_8c.html#a7e49962dc2be19adc1eb81eae2a78320">更多...</a><br /></td></tr>
<tr class="separator:a7e49962dc2be19adc1eb81eae2a78320"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a27e05527d357738dc88150ec892e0a"><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a2a27e05527d357738dc88150ec892e0a">UserBoot_Version</a> = 0x20221016</td></tr>
<tr class="memdesc:a2a27e05527d357738dc88150ec892e0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">UserBoot 程序版本  <a href="userboot_8c.html#a2a27e05527d357738dc88150ec892e0a">更多...</a><br /></td></tr>
<tr class="separator:a2a27e05527d357738dc88150ec892e0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7b25dc5a7178e72dbb35375eb06604d"><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#ab7b25dc5a7178e72dbb35375eb06604d">Firmware_Addr</a> = <a class="el" href="userboot_8c.html#a71659dad8cb67ca7cd6b16840ad9b2f3">UserBoot_Addr</a> + <a class="el" href="userboot_8c.html#a7e49962dc2be19adc1eb81eae2a78320">UserBoot_Size</a></td></tr>
<tr class="memdesc:ab7b25dc5a7178e72dbb35375eb06604d"><td class="mdescLeft">&#160;</td><td class="mdescRight">APP 加载地址  <a href="userboot_8c.html#ab7b25dc5a7178e72dbb35375eb06604d">更多...</a><br /></td></tr>
<tr class="separator:ab7b25dc5a7178e72dbb35375eb06604d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacc50e52c6d7172179c43b3dbc22b7e1"><td class="memItemLeft" align="right" valign="top">static const uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#aacc50e52c6d7172179c43b3dbc22b7e1">Firmware_Max_Size</a> = <a class="el" href="userboot_8c.html#ac8462a2c24f4214d1a59575a24920bbe">Chip_Flash_Max_Size</a> - <a class="el" href="userboot_8c.html#ab7b25dc5a7178e72dbb35375eb06604d">Firmware_Addr</a></td></tr>
<tr class="memdesc:aacc50e52c6d7172179c43b3dbc22b7e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">APP 大小上限  <a href="userboot_8c.html#aacc50e52c6d7172179c43b3dbc22b7e1">更多...</a><br /></td></tr>
<tr class="separator:aacc50e52c6d7172179c43b3dbc22b7e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61b57d538c8e4da2b8682a3eb2262757"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="structdev__info__t.html">dev_info_t</a> *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a61b57d538c8e4da2b8682a3eb2262757">Device_Info</a> = (const <a class="el" href="structdev__info__t.html">dev_info_t</a> *const)(<a class="el" href="userboot_8c.html#ab7b25dc5a7178e72dbb35375eb06604d">Firmware_Addr</a> - <a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>)</td></tr>
<tr class="memdesc:a61b57d538c8e4da2b8682a3eb2262757"><td class="mdescLeft">&#160;</td><td class="mdescRight">将设备信息存储于 ROM 中(可以是 Chip-Flash 或 SPI-Flash )&lt;以 4K Bytes 地址对齐存储于 UserBoot 末尾 &lt;-&gt; APP 运行地址前&gt; 注意 : 该定向指针只读, 不允许写入, 写入须调用 <a class="el" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846" title="写入固件信息, 并自带回读校验">set_device_info()</a> 函数  <a href="userboot_8c.html#a61b57d538c8e4da2b8682a3eb2262757">更多...</a><br /></td></tr>
<tr class="separator:a61b57d538c8e4da2b8682a3eb2262757"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a270e2ece511b8901a7b62fbb52579127"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997">disk_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a270e2ece511b8901a7b62fbb52579127">Move_Disk</a> = <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997a65f6b55fdc64778bf10632a795b97761">USB</a></td></tr>
<tr class="memdesc:a270e2ece511b8901a7b62fbb52579127"><td class="mdescLeft">&#160;</td><td class="mdescRight">当第一次上电没有固件时, 默认去搜寻的外部磁盘类型(考虑到 SWM34SCE-48Pin 没有 SDIO 端口)  <a href="userboot_8c.html#a270e2ece511b8901a7b62fbb52579127">更多...</a><br /></td></tr>
<tr class="separator:a270e2ece511b8901a7b62fbb52579127"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24048df1d0e7c6baee931ac9501003b6"><td class="memItemLeft" align="right" valign="top">const char *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a24048df1d0e7c6baee931ac9501003b6">Firmware_Name_Update</a> = &quot;Firmware_SWM34S_Admin.bin&quot;</td></tr>
<tr class="memdesc:a24048df1d0e7c6baee931ac9501003b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">存放至本地 (SPI-Flash) 的待更新固件文件名  <a href="userboot_8c.html#a24048df1d0e7c6baee931ac9501003b6">更多...</a><br /></td></tr>
<tr class="separator:a24048df1d0e7c6baee931ac9501003b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a538e1fe7d9d421fde968ca66d523f230"><td class="memItemLeft" align="right" valign="top">const char *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a538e1fe7d9d421fde968ca66d523f230">Firmware_Name_Backup</a> = &quot;Firmware_SWM34S_Backups.bin&quot;</td></tr>
<tr class="memdesc:a538e1fe7d9d421fde968ca66d523f230"><td class="mdescLeft">&#160;</td><td class="mdescRight">存放至本地 (SPI-Flash) 的备份固件文件名  <a href="userboot_8c.html#a538e1fe7d9d421fde968ca66d523f230">更多...</a><br /></td></tr>
<tr class="separator:a538e1fe7d9d421fde968ca66d523f230"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28c8f7a4d5f717351aca6027fd3d7ab7"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997">disk_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a28c8f7a4d5f717351aca6027fd3d7ab7">Firmware_Disk</a> = <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997aefea9eb0772378037221a3f1fe759a76">SPI</a></td></tr>
<tr class="memdesc:a28c8f7a4d5f717351aca6027fd3d7ab7"><td class="mdescLeft">&#160;</td><td class="mdescRight">本地磁盘类型  <a href="userboot_8c.html#a28c8f7a4d5f717351aca6027fd3d7ab7">更多...</a><br /></td></tr>
<tr class="separator:a28c8f7a4d5f717351aca6027fd3d7ab7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38146cd83df0f418546b0eadaeb369ff"><td class="memItemLeft" align="right" valign="top">static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a38146cd83df0f418546b0eadaeb369ff">Read_Buff</a> [<a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>]</td></tr>
<tr class="memdesc:a38146cd83df0f418546b0eadaeb369ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">读缓冲区(消耗RAM太大, 优化放置在 SDRAM )  <a href="userboot_8c.html#a38146cd83df0f418546b0eadaeb369ff">更多...</a><br /></td></tr>
<tr class="separator:a38146cd83df0f418546b0eadaeb369ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a0b2732c5f61ce1fb64c5c1e63f6df3"><td class="memItemLeft" align="right" valign="top">static uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="userboot_8c.html#a4a0b2732c5f61ce1fb64c5c1e63f6df3">Write_Buff</a> [<a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>]</td></tr>
<tr class="memdesc:a4a0b2732c5f61ce1fb64c5c1e63f6df3"><td class="mdescLeft">&#160;</td><td class="mdescRight">写缓冲区(消耗RAM太大, 优化放置在 SDRAM )  <a href="userboot_8c.html#a4a0b2732c5f61ce1fb64c5c1e63f6df3">更多...</a><br /></td></tr>
<tr class="separator:a4a0b2732c5f61ce1fb64c5c1e63f6df3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p >IAP 实现 UserBoot 功能 </p>
<p >必看说明 : 由于 UserBoot 属于一个功能模块, 需要结合 APP 使用, 且 UserBoot 并不是所有人都需要用, 故此处没有帮用户设置成 &lt;开箱即用&gt; 的方式. 针对本工程内所有目标(除 UserBoot 自身) =&gt; 要使用 UserBoot , 必须在 Keil 下修改 每个 APP 固件 的 下载地址 与 大小, 将固件 下载起始地址 设为 [0x10000], 大小 设为 [0x70000].</p>
<p >修改方法须根据 在 Keil 工程的 Option -&gt; Linker 的 [User Memory Layout from Target Dialog] 选项是否被&lt;勾选&gt; 分为如下情况:</p>
<p >一、[未勾选 X ] : 在 Keil 工程的 Option -&gt; Linker 的 Scatter File 项点击 Edit... , 修改 [LR_IROM1] 与 [ER_IROM1] 的 &lt;Start&gt; &lt;Size&gt; 值</p>
<p >二、[已勾选 √ ] : 在 Keil 工程的 Option -&gt; Target -&gt; Read Only Memory Areas [on-chip] 中设置 &lt;已被勾选的&gt; Start 与 Size 值</p>
<p >如无特殊情况, 本例程已将所有目标(除 UserBoot 自身)设为上述第 一 种情形, 两种情形互斥, 一方有效则另一方无效.</p>
<p >而对于 UserBoot 目标, 笔者已将各项值设定好/无须用户修改, 此外, 上述所有值均依赖于本文件的 &lt;UserBoot_Size = 0x10000&gt; 计算得出. </p><dl class="section since"><dt>自从</dt><dd>Change Logs: Date Author Notes 2022-12-08 lzh the first version </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>UserBoot 编写说明 : Device Firmware Update (OTA须借助外部无线模块)</dd></dl>
<p>加载方式 : 待更新的固件以文件形式存储于用户外部存储介质中, 待用户插入外部存储介质, 将待更新的固件拷贝至 SPI-Flash 本地离线存储, 便于当用户选择合适的时机再(重启)执行更新动作 拷贝至 Chip-Flash 执行 如此使得 固件下载拷贝 与 固件更新 的动作得到分隔, 当用户执行 固件更新 时, 如检测到 Chip-Flash 中已有固件, 会将 旧固件 备份至 SPI-Flash 本地离线存储, 用于系统宕机时的 固件恢复, 若更新成功则会再次备份现有最新固件.</p>
<p >存储方式 : 双分区[备份区放在 SPI-Flash ] &lt;若备份区放在 Chip-Flash 对 Chip-Flash 大小要求较高, 需要压缩 APP&gt;, 后台式下载新固件至 SPI-Flash , 在更新至 chip-Flash 时作读出 旧固件 备份至 SPI-Flash, 若固件更新成功, 则保留在 SPI-Flash 本地离线存储 的待更新固件 会删除掉, 避免触发重复更新动作.</p>
<p >加密方式 : 固件(*.bin)头部加入固件信息头(带 CRC32 校验), 利用每一颗芯片内的 UID 作 &lt;密钥&gt; 将存储在 SPI-Flash 本地的离线固件进行加密, 除本机外其他机器无法使用, 但不利于 SPI-Flash 母片批量烧录方法</p>
<p >(SWM341 没有硬件加密模块, 须软件实现加密算法: 对称 - AES, 非对称 - RSA/ECC, 哈希 - MD5&lt;不可还原&gt;)</p>
<p >须提示用户, 在更新时出现1~2次重启是正常现象, 例如 Windows 更新.</p>
<p >由于本例程适配各种分辨率的屏, 加之考虑到更新过程不会经常触发, 本着在 UB 中尽量精简 外设/功能 的设计原则, 故目前的 UserBoot 未实现屏显. 更新过程中 可以增加不同颜色 LED 灯 快/慢 闪烁、蜂鸣器发声 等用户提示.</p>
<dl class="test"><dt><b><a class="el" href="test.html#_test000003">测试:</a></b></dt><dd>实际测试 UserBoot 更新 APP 固件时间约 30 s 以内, 备份 APP 同上. </dd></dl>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000002">待办事项:</a></b></dt><dd>增加线性地址写入</dd></dl>
<dl class="section attention"><dt>注意</dt><dd></dd></dl>
<p>THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, SYNWIT SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONN- -ECTION WITH THEIR PRODUCTS.</p>
<dl class="section copyright"><dt>版权所有</dt><dd>2012 Synwit Technology </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 中定义.</p>
</div><h2 class="groupheader">宏定义说明</h2>
<a id="a126cd8ab631c9b09085d875642eaafc8" name="a126cd8ab631c9b09085d875642eaafc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a126cd8ab631c9b09085d875642eaafc8">&#9670;&#160;</a></span>UB_DEBUG_ENABLE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UB_DEBUG_ENABLE</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>模块调试日志输出使能宏 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00068">68</a> 行定义.</p>

</div>
</div>
<a id="a2a6f5a01513f0f9ca1e58abdd5fdf68d" name="a2a6f5a01513f0f9ca1e58abdd5fdf68d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a6f5a01513f0f9ca1e58abdd5fdf68d">&#9670;&#160;</a></span>UB_LOG</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define UB_LOG</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em></td><td>)</td>
          <td>&#160;&#160;&#160;printf(__VA_ARGS__)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>模块调试日志打印宏 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00072">72</a> 行定义.</p>

</div>
</div>
<a id="a19a96f539c8c822d99992939cc6e6a29" name="a19a96f539c8c822d99992939cc6e6a29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19a96f539c8c822d99992939cc6e6a29">&#9670;&#160;</a></span>Flash_Alignment</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Flash_Alignment&#160;&#160;&#160;(4096)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Flash-IAP 操作须对齐的大小( 4K 对齐 ) </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00101">101</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">函数说明</h2>
<a id="a01aae38566ae3dd519a6c18696ab2806" name="a01aae38566ae3dd519a6c18696ab2806"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01aae38566ae3dd519a6c18696ab2806">&#9670;&#160;</a></span>reset_mcu()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void reset_mcu </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>重启 MCU </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>相比于 NVIC_SystemReset() , 看门狗从硬件层面保证可靠性, 可确保寄存器的复位值均恢复默认. </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00625">625</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a01aae38566ae3dd519a6c18696ab2806_icgraph.png" border="0" usemap="#auserboot_8c_a01aae38566ae3dd519a6c18696ab2806_icgraph" alt=""/></div>
<map name="auserboot_8c_a01aae38566ae3dd519a6c18696ab2806_icgraph" id="auserboot_8c_a01aae38566ae3dd519a6c18696ab2806_icgraph">
<area shape="rect" title="重启 MCU" alt="" coords="808,31,891,56"/>
<area shape="rect" href="userboot_8c.html#acdd804b92809fcd58b2bc135fc74666c" title="跳转至 UserBoot 执行对应动作" alt="" coords="635,5,760,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="503,56,575,81"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="492,5,587,31"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="353,5,444,31"/>
<area shape="rect" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,5,305,31"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,5,179,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,31,56,56"/>
</map>
</div>

</div>
</div>
<a id="a78c7624204dca44707593279758c0c98" name="a78c7624204dca44707593279758c0c98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78c7624204dca44707593279758c0c98">&#9670;&#160;</a></span>jump_to_app()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void jump_to_app </td>
          <td>(</td>
          <td class="paramtype">const uint32_t&#160;</td>
          <td class="paramname"><em>addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>跳转至 APP 加载地址运行 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>: APP 加载地址 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>通过判断栈定地址值来辨别传入地址上的应用程序是否有效 </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00639">639</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a78c7624204dca44707593279758c0c98_icgraph.png" border="0" usemap="#auserboot_8c_a78c7624204dca44707593279758c0c98_icgraph" alt=""/></div>
<map name="auserboot_8c_a78c7624204dca44707593279758c0c98_icgraph" id="auserboot_8c_a78c7624204dca44707593279758c0c98_icgraph">
<area shape="rect" title="跳转至 APP 加载地址运行" alt="" coords="224,5,320,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="104,5,176,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,5,56,31"/>
</map>
</div>

</div>
</div>
<a id="aeeea4715dd32a4a4ecdf61a2869d1307" name="aeeea4715dd32a4a4ecdf61a2869d1307"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeeea4715dd32a4a4ecdf61a2869d1307">&#9670;&#160;</a></span>calculate_crc()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t calculate_crc </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structfw__info__t.html">fw_info_t</a> *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>计算 CRC 校验和 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>: APP 固件信息 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">crc</td><td>: 校验和 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>前置条件</dt><dd>依赖 CRC 硬件, 须在本函数调用前完成 CRC 外设的初始化. </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00679">679</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_cgraph.png" border="0" usemap="#auserboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_cgraph" alt=""/></div>
<map name="auserboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_cgraph" id="auserboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_cgraph">
<area shape="rect" title="计算 CRC 校验和" alt="" coords="5,5,104,31"/>
<area shape="rect" href="dev__crc_8c.html#a64e0abe6c28e0480424c1e467afb7430" title="计算 CRC32 校验和" alt="" coords="152,5,231,31"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_icgraph.png" border="0" usemap="#auserboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_icgraph" alt=""/></div>
<map name="auserboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_icgraph" id="auserboot_8c_aeeea4715dd32a4a4ecdf61a2869d1307_icgraph">
<area shape="rect" title="计算 CRC 校验和" alt="" coords="813,81,912,107"/>
<area shape="rect" href="userboot_8c.html#a43be464e9071b97862e51b2273afd856" title="固件备份 (Chip&#45;Flash&lt;运行区&gt; =&gt; 本地存储&lt;备份区&gt;)" alt="" coords="641,5,759,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="503,105,575,131"/>
<area shape="rect" href="userboot_8c.html#a759a4106353e92e06e9d15926228c576" title="固件下载 (外部 =&gt; 本地)" alt="" coords="635,156,765,181"/>
<area shape="rect" href="userboot_8c.html#ae1cbf84771d87b5530710ae6852bd827" title="固件更新 (本地存储&lt;备份区&gt; =&gt; Chip&#45;Flash&lt;运行区&gt;)" alt="" coords="642,107,758,132"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,131,56,156"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="492,156,587,181"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="353,156,444,181"/>
<area shape="rect" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,156,305,181"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,156,179,181"/>
</map>
</div>

</div>
</div>
<a id="a9412f435ea365342178b2399fc08a846" name="a9412f435ea365342178b2399fc08a846"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9412f435ea365342178b2399fc08a846">&#9670;&#160;</a></span>set_device_info()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint8_t set_device_info </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structdev__info__t.html">dev_info_t</a> *&#160;</td>
          <td class="paramname"><em>ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>写入固件信息, 并自带回读校验 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ptr</td><td>: 设备信息结构体指针 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00690">690</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a9412f435ea365342178b2399fc08a846_icgraph.png" border="0" usemap="#auserboot_8c_a9412f435ea365342178b2399fc08a846_icgraph" alt=""/></div>
<map name="auserboot_8c_a9412f435ea365342178b2399fc08a846_icgraph" id="auserboot_8c_a9412f435ea365342178b2399fc08a846_icgraph">
<area shape="rect" title="写入固件信息, 并自带回读校验" alt="" coords="808,56,919,81"/>
<area shape="rect" href="userboot_8c.html#ae1cbf84771d87b5530710ae6852bd827" title="固件更新 (本地存储&lt;备份区&gt; =&gt; Chip&#45;Flash&lt;运行区&gt;)" alt="" coords="639,5,755,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="503,56,575,81"/>
<area shape="rect" href="userboot_8c.html#acdd804b92809fcd58b2bc135fc74666c" title="跳转至 UserBoot 执行对应动作" alt="" coords="635,107,760,132"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,81,56,107"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="492,107,587,132"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="353,107,444,132"/>
<area shape="rect" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,107,305,132"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,107,179,132"/>
</map>
</div>

</div>
</div>
<a id="a43be464e9071b97862e51b2273afd856" name="a43be464e9071b97862e51b2273afd856"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43be464e9071b97862e51b2273afd856">&#9670;&#160;</a></span>firmware_backup()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint8_t firmware_backup </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="userboot_8h.html#a73b10fad3e8bed1f1afc0b09e52b4498">data_code_cb</a>&#160;</td>
          <td class="paramname"><em>data_enc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>固件备份 (Chip-Flash&lt;运行区&gt; =&gt; 本地存储&lt;备份区&gt;) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>: 待备份固件的绝对路径 </td></tr>
    <tr><td class="paramname">data_enc</td><td>: 数据加密回调 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>前置条件</dt><dd>须保证 目标固件 对应磁盘的文件系统处于挂载状态 </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00739">739</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a43be464e9071b97862e51b2273afd856_cgraph.png" border="0" usemap="#auserboot_8c_a43be464e9071b97862e51b2273afd856_cgraph" alt=""/></div>
<map name="auserboot_8c_a43be464e9071b97862e51b2273afd856_cgraph" id="auserboot_8c_a43be464e9071b97862e51b2273afd856_cgraph">
<area shape="rect" title="固件备份 (Chip&#45;Flash&lt;运行区&gt; =&gt; 本地存储&lt;备份区&gt;)" alt="" coords="5,5,124,31"/>
<area shape="rect" href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307" title="计算 CRC 校验和" alt="" coords="172,5,271,31"/>
<area shape="rect" href="dev__crc_8c.html#a64e0abe6c28e0480424c1e467afb7430" title="计算 CRC32 校验和" alt="" coords="319,5,397,31"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a43be464e9071b97862e51b2273afd856_icgraph.png" border="0" usemap="#auserboot_8c_a43be464e9071b97862e51b2273afd856_icgraph" alt=""/></div>
<map name="auserboot_8c_a43be464e9071b97862e51b2273afd856_icgraph" id="auserboot_8c_a43be464e9071b97862e51b2273afd856_icgraph">
<area shape="rect" title="固件备份 (Chip&#45;Flash&lt;运行区&gt; =&gt; 本地存储&lt;备份区&gt;)" alt="" coords="224,5,343,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="104,5,176,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,5,56,31"/>
</map>
</div>

</div>
</div>
<a id="ae1cbf84771d87b5530710ae6852bd827" name="ae1cbf84771d87b5530710ae6852bd827"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1cbf84771d87b5530710ae6852bd827">&#9670;&#160;</a></span>firmware_update()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint8_t firmware_update </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="userboot_8h.html#a73b10fad3e8bed1f1afc0b09e52b4498">data_code_cb</a>&#160;</td>
          <td class="paramname"><em>data_dec</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>固件更新 (本地存储&lt;备份区&gt; =&gt; Chip-Flash&lt;运行区&gt;) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>: 待更新固件的绝对路径 </td></tr>
    <tr><td class="paramname">data_dec</td><td>: 数据解密回调 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>前置条件</dt><dd>须保证 源固件 对应磁盘的文件系统处于挂载状态 </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00841">841</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_ae1cbf84771d87b5530710ae6852bd827_cgraph.png" border="0" usemap="#auserboot_8c_ae1cbf84771d87b5530710ae6852bd827_cgraph" alt=""/></div>
<map name="auserboot_8c_ae1cbf84771d87b5530710ae6852bd827_cgraph" id="auserboot_8c_ae1cbf84771d87b5530710ae6852bd827_cgraph">
<area shape="rect" title="固件更新 (本地存储&lt;备份区&gt; =&gt; Chip&#45;Flash&lt;运行区&gt;)" alt="" coords="5,31,121,56"/>
<area shape="rect" href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307" title="计算 CRC 校验和" alt="" coords="175,5,274,31"/>
<area shape="rect" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846" title="写入固件信息, 并自带回读校验" alt="" coords="169,55,280,80"/>
<area shape="rect" href="dev__crc_8c.html#a64e0abe6c28e0480424c1e467afb7430" title="计算 CRC32 校验和" alt="" coords="328,5,407,31"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_ae1cbf84771d87b5530710ae6852bd827_icgraph.png" border="0" usemap="#auserboot_8c_ae1cbf84771d87b5530710ae6852bd827_icgraph" alt=""/></div>
<map name="auserboot_8c_ae1cbf84771d87b5530710ae6852bd827_icgraph" id="auserboot_8c_ae1cbf84771d87b5530710ae6852bd827_icgraph">
<area shape="rect" title="固件更新 (本地存储&lt;备份区&gt; =&gt; Chip&#45;Flash&lt;运行区&gt;)" alt="" coords="224,5,340,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="104,5,176,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,5,56,31"/>
</map>
</div>

</div>
</div>
<a id="a5d51bf8d3184d1c34b5fde41d69b1559" name="a5d51bf8d3184d1c34b5fde41d69b1559"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d51bf8d3184d1c34b5fde41d69b1559">&#9670;&#160;</a></span>userboot()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void userboot </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>UserBoot 功能 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>本函数会一直阻塞在被调用处, 之后的语句都不会得到执行 </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00168">168</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_cgraph.png" border="0" usemap="#auserboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_cgraph" alt=""/></div>
<map name="auserboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_cgraph" id="auserboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_cgraph">
<area shape="rect" title="UserBoot 功能" alt="" coords="5,329,77,355"/>
<area shape="rect" href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307" title="计算 CRC 校验和" alt="" coords="324,228,423,253"/>
<area shape="rect" href="dev__crc_8c.html#af9273c2c56ccb1b14946a43defe57f6b" title="硬件 CRC 初始化" alt="" coords="159,55,223,80"/>
<area shape="rect" href="userboot_8c.html#a0591f13c34e15c4d9fbe31fd99726a94" title="数据解密" alt="" coords="143,104,239,129"/>
<area shape="rect" href="userboot_8c.html#a52a519a37465a7b4515a237114afa802" title="数据加密" alt="" coords="143,153,239,179"/>
<area shape="rect" href="userboot_8c.html#a43be464e9071b97862e51b2273afd856" title="固件备份 (Chip&#45;Flash&lt;运行区&gt; =&gt; 本地存储&lt;备份区&gt;)" alt="" coords="131,5,250,31"/>
<area shape="rect" href="userboot_8c.html#a759a4106353e92e06e9d15926228c576" title="固件下载 (外部 =&gt; 本地)" alt="" coords="125,203,256,228"/>
<area shape="rect" href="userboot_8c.html#ae1cbf84771d87b5530710ae6852bd827" title="固件更新 (本地存储&lt;备份区&gt; =&gt; Chip&#45;Flash&lt;运行区&gt;)" alt="" coords="133,304,249,329"/>
<area shape="rect" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846" title="写入固件信息, 并自带回读校验" alt="" coords="318,355,429,380"/>
<area shape="rect" href="load__file_8c.html#aebe4a0d647831986c734e1788150a064" title="为磁盘挂载文件系统" alt="" coords="153,556,228,581"/>
<area shape="rect" href="load__file_8c.html#a2826c976bae07983300096521da284b4" title="为磁盘卸载文件系统" alt="" coords="329,607,418,632"/>
<area shape="rect" href="userboot_8c.html#a78c7624204dca44707593279758c0c98" title="跳转至 APP 加载地址运行" alt="" coords="143,507,239,532"/>
<area shape="rect" href="userboot_8c.html#acdd804b92809fcd58b2bc135fc74666c" title="跳转至 UserBoot 执行对应动作" alt="" coords="128,405,253,431"/>
<area shape="rect" href="userboot_8c.html#a01aae38566ae3dd519a6c18696ab2806" title="重启 MCU" alt="" coords="332,431,415,456"/>
<area shape="rect" href="dev__uart_8c.html#afd092ef1d390fe16bc90e101bbbca1d8" title="初始化用作打印调试日志的串口" alt="" coords="135,657,246,683"/>
<area shape="rect" href="dev__crc_8c.html#a64e0abe6c28e0480424c1e467afb7430" title="计算 CRC32 校验和" alt="" coords="510,228,589,253"/>
<area shape="rect" href="load__file_8c.html#a51d572edecc93d80a160b93843fb5208" title="磁盘新建卷, 重置清空卷" alt="" coords="340,556,407,581"/>
<area shape="rect" href="dev__uart_8c.html#aadbe4996756dcc6199bc9ec2e4969993" title="配置串口打印调试日志的端口" alt="" coords="304,657,443,683"/>
<area shape="rect" href="dev__uart_8c.html#ac12e742cf904e08383401dd68a88001b" title="串口（SWD）端口功能切换" alt="" coords="491,657,608,683"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_icgraph.png" border="0" usemap="#auserboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_icgraph" alt=""/></div>
<map name="auserboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_icgraph" id="auserboot_8c_a5d51bf8d3184d1c34b5fde41d69b1559_icgraph">
<area shape="rect" title="UserBoot 功能" alt="" coords="104,5,176,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,5,56,31"/>
</map>
</div>

</div>
</div>
<a id="acdd804b92809fcd58b2bc135fc74666c" name="acdd804b92809fcd58b2bc135fc74666c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acdd804b92809fcd58b2bc135fc74666c">&#9670;&#160;</a></span>jump_to_userboot()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jump_to_userboot </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>boot_flag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wait</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>跳转至 UserBoot 执行对应动作 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">boot_flag</td><td>: UserBoot 引导启动标志(详见对应枚举) </td></tr>
    <tr><td class="paramname">wait</td><td>: 是否立即跳转 (true-立即复位跳转 false-等待用户手动复位后跳转) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>此函数会改变 Chip-Flash 内部分区域的数据, 若片内不含 UB 程序, 则调用本程序会导致 APP 的正常数据被破坏. </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00417">417</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_acdd804b92809fcd58b2bc135fc74666c_cgraph.png" border="0" usemap="#auserboot_8c_acdd804b92809fcd58b2bc135fc74666c_cgraph" alt=""/></div>
<map name="auserboot_8c_acdd804b92809fcd58b2bc135fc74666c_cgraph" id="auserboot_8c_acdd804b92809fcd58b2bc135fc74666c_cgraph">
<area shape="rect" title="跳转至 UserBoot 执行对应动作" alt="" coords="5,31,131,56"/>
<area shape="rect" href="userboot_8c.html#a01aae38566ae3dd519a6c18696ab2806" title="重启 MCU" alt="" coords="193,5,275,31"/>
<area shape="rect" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846" title="写入固件信息, 并自带回读校验" alt="" coords="179,55,289,80"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_acdd804b92809fcd58b2bc135fc74666c_icgraph.png" border="0" usemap="#auserboot_8c_acdd804b92809fcd58b2bc135fc74666c_icgraph" alt=""/></div>
<map name="auserboot_8c_acdd804b92809fcd58b2bc135fc74666c_icgraph" id="auserboot_8c_acdd804b92809fcd58b2bc135fc74666c_icgraph">
<area shape="rect" title="跳转至 UserBoot 执行对应动作" alt="" coords="635,31,760,56"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="492,5,587,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="363,56,435,81"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="353,5,444,31"/>
<area shape="rect" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,5,305,31"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,5,179,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,31,56,56"/>
</map>
</div>

</div>
</div>
<a id="a759a4106353e92e06e9d15926228c576" name="a759a4106353e92e06e9d15926228c576"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a759a4106353e92e06e9d15926228c576">&#9670;&#160;</a></span>firmware_download()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t firmware_download </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>src_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dst_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="userboot_8h.html#a73b10fad3e8bed1f1afc0b09e52b4498">data_code_cb</a>&#160;</td>
          <td class="paramname"><em>data_enc</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>固件下载 (外部 =&gt; 本地) </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">src_path</td><td>: 外部固件绝对路径 </td></tr>
    <tr><td class="paramname">dst_path</td><td>: 本地固件绝对路径 </td></tr>
    <tr><td class="paramname">data_enc</td><td>: 数据加密回调 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>前置条件</dt><dd>须保证 源/目标 固件对应磁盘的文件系统处于挂载状态 </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00461">461</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a759a4106353e92e06e9d15926228c576_cgraph.png" border="0" usemap="#auserboot_8c_a759a4106353e92e06e9d15926228c576_cgraph" alt=""/></div>
<map name="auserboot_8c_a759a4106353e92e06e9d15926228c576_cgraph" id="auserboot_8c_a759a4106353e92e06e9d15926228c576_cgraph">
<area shape="rect" title="固件下载 (外部 =&gt; 本地)" alt="" coords="5,5,136,31"/>
<area shape="rect" href="userboot_8c.html#aeeea4715dd32a4a4ecdf61a2869d1307" title="计算 CRC 校验和" alt="" coords="184,5,283,31"/>
<area shape="rect" href="dev__crc_8c.html#a64e0abe6c28e0480424c1e467afb7430" title="计算 CRC32 校验和" alt="" coords="331,5,409,31"/>
</map>
</div>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a759a4106353e92e06e9d15926228c576_icgraph.png" border="0" usemap="#auserboot_8c_a759a4106353e92e06e9d15926228c576_icgraph" alt=""/></div>
<map name="auserboot_8c_a759a4106353e92e06e9d15926228c576_icgraph" id="auserboot_8c_a759a4106353e92e06e9d15926228c576_icgraph">
<area shape="rect" title="固件下载 (外部 =&gt; 本地)" alt="" coords="635,31,765,56"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="492,5,587,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="363,56,435,81"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="353,5,444,31"/>
<area shape="rect" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,5,305,31"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,5,179,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,31,56,56"/>
</map>
</div>

</div>
</div>
<a id="a52a519a37465a7b4515a237114afa802" name="a52a519a37465a7b4515a237114afa802"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52a519a37465a7b4515a237114afa802">&#9670;&#160;</a></span>data_encode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int data_encode </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>src_buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst_buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>数据加密 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">src_buff</td><td>: 数据源 </td></tr>
    <tr><td class="paramname">dst_buff</td><td>: 输出流 </td></tr>
    <tr><td class="paramname">bytes</td><td>: 数据量( AES 分组长度 128 bit == 16 Bytes, 数据量必须被该长度整除) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>可使用 芯片唯一 96 bit ID 实现加密算法: 对称 - AES, 非对称 - RSA/ECC, 哈希 - MD5&lt;不可还原&gt; </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00587">587</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a52a519a37465a7b4515a237114afa802_icgraph.png" border="0" usemap="#auserboot_8c_a52a519a37465a7b4515a237114afa802_icgraph" alt=""/></div>
<map name="auserboot_8c_a52a519a37465a7b4515a237114afa802_icgraph" id="auserboot_8c_a52a519a37465a7b4515a237114afa802_icgraph">
<area shape="rect" title="数据加密" alt="" coords="635,31,731,56"/>
<area shape="rect" href="ui__update_8c.html#a3dbd73c82f05a5370635333b5ed68aea" title="点击不同的按钮后, 由此函数执行对应动作" alt="" coords="492,5,587,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="363,56,435,81"/>
<area shape="rect" href="ui__update_8c.html#a4b62aef18e10709cce125faee1b7dd52" title="文件管理器" alt="" coords="353,5,444,31"/>
<area shape="rect" href="ui__update_8c.html#aea66c53fcc188fefaa3470555db6aa05" title="启动 UI 引导加载界面, 挂载文件系统以实现 UI 素材导入/更新" alt="" coords="227,5,305,31"/>
<area shape="rect" href="main_8c.html#a8f1efe6291a27ae9b326f0c8a236c102" title="Go to User App Execute" alt="" coords="104,5,179,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,31,56,56"/>
</map>
</div>

</div>
</div>
<a id="a0591f13c34e15c4d9fbe31fd99726a94" name="a0591f13c34e15c4d9fbe31fd99726a94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0591f13c34e15c4d9fbe31fd99726a94">&#9670;&#160;</a></span>data_decode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int data_decode </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>src_buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>dst_buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>bytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>数据解密 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">src_buff</td><td>: 数据源 </td></tr>
    <tr><td class="paramname">dst_buff</td><td>: 输出流 </td></tr>
    <tr><td class="paramname">bytes</td><td>: 数据量( AES 分组长度 128 bit == 16 Bytes, 数据量必须被该长度整除) </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>: success </td></tr>
    <tr><td class="paramname">other</td><td>: error code </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>依据 数据加密规则 <a class="el" href="userboot_8c.html#a52a519a37465a7b4515a237114afa802" title="数据加密">data_encode()</a> 逆向进行解码 </dd></dl>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00606">606</a> 行定义.</p>
<div class="dynheader">
这是这个函数的调用关系图:</div>
<div class="dyncontent">
<div class="center"><img src="userboot_8c_a0591f13c34e15c4d9fbe31fd99726a94_icgraph.png" border="0" usemap="#auserboot_8c_a0591f13c34e15c4d9fbe31fd99726a94_icgraph" alt=""/></div>
<map name="auserboot_8c_a0591f13c34e15c4d9fbe31fd99726a94_icgraph" id="auserboot_8c_a0591f13c34e15c4d9fbe31fd99726a94_icgraph">
<area shape="rect" title="数据解密" alt="" coords="224,5,320,31"/>
<area shape="rect" href="userboot_8c.html#a5d51bf8d3184d1c34b5fde41d69b1559" title="UserBoot 功能" alt="" coords="104,5,176,31"/>
<area shape="rect" href="main_8c.html#a840291bc02cba5474a4cb46a9b9566fe" title="C_Main" alt="" coords="5,5,56,31"/>
</map>
</div>

</div>
</div>
<h2 class="groupheader">变量说明</h2>
<a id="ac8462a2c24f4214d1a59575a24920bbe" name="ac8462a2c24f4214d1a59575a24920bbe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8462a2c24f4214d1a59575a24920bbe">&#9670;&#160;</a></span>Chip_Flash_Max_Size</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t Chip_Flash_Max_Size = 0x80000</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>SWM341 系列 Flash 容量上限 512K Bytes </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00102">102</a> 行定义.</p>

</div>
</div>
<a id="a71659dad8cb67ca7cd6b16840ad9b2f3" name="a71659dad8cb67ca7cd6b16840ad9b2f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71659dad8cb67ca7cd6b16840ad9b2f3">&#9670;&#160;</a></span>UserBoot_Addr</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t UserBoot_Addr = 0x00000</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>UserBoot 加载地址 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00103">103</a> 行定义.</p>

</div>
</div>
<a id="a7e49962dc2be19adc1eb81eae2a78320" name="a7e49962dc2be19adc1eb81eae2a78320"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e49962dc2be19adc1eb81eae2a78320">&#9670;&#160;</a></span>UserBoot_Size</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t UserBoot_Size = 0x10000</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>UserBoot 预设大小 &lt;4K 对齐&gt; (可预留多一些, 以便后续有更新 UserBoot 的需求, 暂未预留接口实现) </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00104">104</a> 行定义.</p>

</div>
</div>
<a id="a2a27e05527d357738dc88150ec892e0a" name="a2a27e05527d357738dc88150ec892e0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a27e05527d357738dc88150ec892e0a">&#9670;&#160;</a></span>UserBoot_Version</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t UserBoot_Version = 0x20221016</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>UserBoot 程序版本 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00105">105</a> 行定义.</p>

</div>
</div>
<a id="ab7b25dc5a7178e72dbb35375eb06604d" name="ab7b25dc5a7178e72dbb35375eb06604d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7b25dc5a7178e72dbb35375eb06604d">&#9670;&#160;</a></span>Firmware_Addr</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t Firmware_Addr = <a class="el" href="userboot_8c.html#a71659dad8cb67ca7cd6b16840ad9b2f3">UserBoot_Addr</a> + <a class="el" href="userboot_8c.html#a7e49962dc2be19adc1eb81eae2a78320">UserBoot_Size</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>APP 加载地址 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00106">106</a> 行定义.</p>

</div>
</div>
<a id="aacc50e52c6d7172179c43b3dbc22b7e1" name="aacc50e52c6d7172179c43b3dbc22b7e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aacc50e52c6d7172179c43b3dbc22b7e1">&#9670;&#160;</a></span>Firmware_Max_Size</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint32_t Firmware_Max_Size = <a class="el" href="userboot_8c.html#ac8462a2c24f4214d1a59575a24920bbe">Chip_Flash_Max_Size</a> - <a class="el" href="userboot_8c.html#ab7b25dc5a7178e72dbb35375eb06604d">Firmware_Addr</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>APP 大小上限 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00107">107</a> 行定义.</p>

</div>
</div>
<a id="a61b57d538c8e4da2b8682a3eb2262757" name="a61b57d538c8e4da2b8682a3eb2262757"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61b57d538c8e4da2b8682a3eb2262757">&#9670;&#160;</a></span>Device_Info</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structdev__info__t.html">dev_info_t</a>* const Device_Info = (const <a class="el" href="structdev__info__t.html">dev_info_t</a> *const)(<a class="el" href="userboot_8c.html#ab7b25dc5a7178e72dbb35375eb06604d">Firmware_Addr</a> - <a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>将设备信息存储于 ROM 中(可以是 Chip-Flash 或 SPI-Flash )&lt;以 4K Bytes 地址对齐存储于 UserBoot 末尾 &lt;-&gt; APP 运行地址前&gt; 注意 : 该定向指针只读, 不允许写入, 写入须调用 <a class="el" href="userboot_8c.html#a9412f435ea365342178b2399fc08a846" title="写入固件信息, 并自带回读校验">set_device_info()</a> 函数 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00112">112</a> 行定义.</p>

</div>
</div>
<a id="a270e2ece511b8901a7b62fbb52579127" name="a270e2ece511b8901a7b62fbb52579127"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a270e2ece511b8901a7b62fbb52579127">&#9670;&#160;</a></span>Move_Disk</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997">disk_t</a> Move_Disk = <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997a65f6b55fdc64778bf10632a795b97761">USB</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>当第一次上电没有固件时, 默认去搜寻的外部磁盘类型(考虑到 SWM34SCE-48Pin 没有 SDIO 端口) </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00115">115</a> 行定义.</p>

</div>
</div>
<a id="a24048df1d0e7c6baee931ac9501003b6" name="a24048df1d0e7c6baee931ac9501003b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24048df1d0e7c6baee931ac9501003b6">&#9670;&#160;</a></span>Firmware_Name_Update</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* const Firmware_Name_Update = &quot;Firmware_SWM34S_Admin.bin&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>存放至本地 (SPI-Flash) 的待更新固件文件名 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00121">121</a> 行定义.</p>

</div>
</div>
<a id="a538e1fe7d9d421fde968ca66d523f230" name="a538e1fe7d9d421fde968ca66d523f230"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a538e1fe7d9d421fde968ca66d523f230">&#9670;&#160;</a></span>Firmware_Name_Backup</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* const Firmware_Name_Backup = &quot;Firmware_SWM34S_Backups.bin&quot;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>存放至本地 (SPI-Flash) 的备份固件文件名 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00123">123</a> 行定义.</p>

</div>
</div>
<a id="a28c8f7a4d5f717351aca6027fd3d7ab7" name="a28c8f7a4d5f717351aca6027fd3d7ab7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28c8f7a4d5f717351aca6027fd3d7ab7">&#9670;&#160;</a></span>Firmware_Disk</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997">disk_t</a> Firmware_Disk = <a class="el" href="load__file_8h.html#a44edb5dd69763758dda6af4dd162c997aefea9eb0772378037221a3f1fe759a76">SPI</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>本地磁盘类型 </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00125">125</a> 行定义.</p>

</div>
</div>
<a id="a38146cd83df0f418546b0eadaeb369ff" name="a38146cd83df0f418546b0eadaeb369ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a38146cd83df0f418546b0eadaeb369ff">&#9670;&#160;</a></span>Read_Buff</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t Read_Buff[<a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>读缓冲区(消耗RAM太大, 优化放置在 SDRAM ) </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00145">145</a> 行定义.</p>

</div>
</div>
<a id="a4a0b2732c5f61ce1fb64c5c1e63f6df3" name="a4a0b2732c5f61ce1fb64c5c1e63f6df3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a0b2732c5f61ce1fb64c5c1e63f6df3">&#9670;&#160;</a></span>Write_Buff</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t Write_Buff[<a class="el" href="userboot_8c.html#a19a96f539c8c822d99992939cc6e6a29">Flash_Alignment</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>写缓冲区(消耗RAM太大, 优化放置在 SDRAM ) </p>

<p class="definition">在文件 <a class="el" href="userboot_8c_source.html">userboot.c</a> 第 <a class="el" href="userboot_8c_source.html#l00147">147</a> 行定义.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
